package com.duobaoyu.dby.supply.api.controller;

import com.duobaoyu.dby.common.core.util.R;
import com.duobaoyu.dby.common.security.annotation.Inner;
import com.duobaoyu.dby.supply.api.service.RechargeInfoBizService;
import com.duobaoyu.dby.supply.common.biz.remote.dto.rechargeinfo.PhoneOperatorQueryDTO;
import com.duobaoyu.dby.supply.common.biz.remote.to.rechargeinfo.PhoneOperatorTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 充值信息controller
 *
 * @Author yangyong
 * @Date 2023/9/27
 */
@Inner
@RestController
@RequestMapping("/api/recharge-info")
@RequiredArgsConstructor
public class RechargeInfoController {
	private final RechargeInfoBizService rechargeInfoBizService;

	/**
	 * 查询手机号运营商和归属地
	 *
	 * @param phoneOperatorQuery 入参
	 * @return R<PhoneOperatorTO>
	 */
	@ApiOperation("查询手机号运营商和归属地")
	@GetMapping("/queryPhoneOperator")
	public R<PhoneOperatorTO> queryPhoneOperator(@Validated PhoneOperatorQueryDTO phoneOperatorQuery) {
		return R.ok(rechargeInfoBizService.queryPhoneOperator(phoneOperatorQuery));
	}
}
